home *** CD-ROM | disk | FTP | other *** search
- Path: nntp.uio.no!solace!user
- From: lars.farm@nts.mh.se (Lars Farm)
- Newsgroups: comp.lang.c++
- Subject: Re: Why don't you use garbage collection
- Date: Sat, 13 Apr 1996 00:34:44 +0200
- Organization: pv
- Message-ID: <AD94A724966833CA@dialup97-6-14.swipnet.se>
- References: <4kiai0$mjd@dfw-ixnews8.ix.netcom.com>
- NNTP-Posting-Host: dialup97-6-14.swipnet.se
- Mime-Version: 1.0
- Content-Type: text/plain; charset=iso-8859-1
- Content-Transfer-Encoding: 8bit
-
- In article <4kiai0$mjd@dfw-ixnews8.ix.netcom.com>,
- giuliano@ix.netcom.com(Giuliano Carlini) wrote:
-
- >What follows is my belief for why garbage collection is so little used.
- >Feel free to respond to anything I say below, but please, first respond
- >to the questions above. I believe that most people don't use garbage
- >collection because either they:
- > - don't know what it is
- > - don't know it can be used with C/C++.
- > - are misinformation
- > - are biased against it by the C/C++ culture
-
- No. More like:
- - not sanctioned -> Can't trust the library to work with another compiler
- or even a later version of my current compiler. I'd like it in the standard
- as an option, a new storage class. Like stack-based objects, heap-based
- objects and add GC-based objects.
- - there is the problem of destructors that release other resources than
- memory.
-
- >So, do you use garbage collection in your C/C++ programs, and if not,
- >why not?
-
- I do use GC (Boehms collector) but only in my own programs, never in
- programs written for others because of the potential portability problems
- and because my code must coexist with code written by others. GC in the
- standard would solve that problem. It has been mentioned here that the
- committee was initially supposed to consider templates, exceptions and GC.
- It appears they never got to the GC part. Judging by discussions here and
- in c.std.c++ they're not particularly interested either. Cultural clash I
- suppose. Pity. Even an minimalistic and optional language feature that
- describes what GC should do if present would be better than no description.
-
-
-
-